using System.Dynamic;
using System.Linq.Expressions;
using System.Reflection;

namespace System
{
	internal class GetPropertyBinder : GetMemberBinder
	{
		public GetPropertyBinder(string propertyName) : base(propertyName, false)
		{
		}

		public override DynamicMetaObject FallbackGetMember(DynamicMetaObject target, DynamicMetaObject errorSuggestion)
		{
			ConstructorInfo constructor = typeof(InvalidOperationException).GetConstructor(new Type[] { typeof(string) });
			Expression[] expressionArray = new Expression[] { Expression.Constant("Error") };
			DynamicMetaObject dynamicMetaObject = new DynamicMetaObject(Expression.Throw(Expression.New(constructor, expressionArray), ReturnType), BindingRestrictions.Empty);
			return dynamicMetaObject;
		}
	}
}